-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FISH-8302 Virtual Threads Configuration #7198
Merged
aubi
merged 11 commits into
payara:Payara7
from
aubi:FISH-8302-virtual-threads-configuration
Feb 21, 2025
Merged
FISH-8302 Virtual Threads Configuration #7198
aubi
merged 11 commits into
payara:Payara7
from
aubi:FISH-8302-virtual-threads-configuration
Feb 21, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Introduce fallback in case a creation of an implementation of a ManagedExecutorService (virtual or fork&join) fails.
Both AdminUI and command-line asadmin are implemented.
It the configuration specifies to use virtual threads, the new code uses the respective classes for managed scheduled executor service and managed thread factory. Managed executor service was already implemented.
Pandrex247
reviewed
Feb 19, 2025
...rent-impl/src/main/manpages/org/glassfish/concurrent/admin/create-managed-executor-service.1
Outdated
Show resolved
Hide resolved
...src/main/manpages/org/glassfish/concurrent/admin/create-managed-scheduled-executor-service.1
Outdated
Show resolved
Hide resolved
...urrent-impl/src/main/manpages/org/glassfish/concurrent/admin/create-managed-thread-factory.1
Outdated
Show resolved
Hide resolved
Pandrex247
reviewed
Feb 19, 2025
...va/org/glassfish/concurrent/runtime/deployer/ManagedScheduledExecutorDefinitionDeployer.java
Outdated
Show resolved
Hide resolved
Based on Andrew's review suggestion. Co-authored-by: Andrew Pielage <[email protected]>
Based on Andrew's review suggestion. Co-authored-by: Andrew Pielage <[email protected]>
Based on Andrew's review suggestion. Co-authored-by: Andrew Pielage <[email protected]>
Pandrex247
requested changes
Feb 20, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to cause failures in the Concurrency TCK
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] VirtualFullTests.testPlatformScheduledExecutor:72->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualFullTests.testPlatformThreadFactory:83->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualFullTests.testVirtualScheduledExecutor:78->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualFullTests.testVirtualThreadFactory:89->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualWebTests.testPlatformScheduledExecutor:66->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualWebTests.testPlatformThreadFactory:77->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualWebTests.testVirtualScheduledExecutor:72->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] VirtualWebTests.testVirtualThreadFactory:83->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:146 Output did not contain successful message: SUCCESS ==> expected: <true> but was: <false>
[ERROR] Errors:
[ERROR] AnnotationWebTests.testAnnoDefinedContextServiceQualifiers:68->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnoDefinedContextServiceQualifiers
[ERROR] AnnotationWebTests.testAnnoDefinedManagedExecutorSvcQualifiers:73->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnoDefinedManagedExecutorSvcQualifiers
[ERROR] AnnotationWebTests.testAnnoDefinedManagedScheduledExecutorSvcQualifers:78->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.IOException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnoDefinedManagedScheduledExecutorSvcQualifers
[ERROR] AnnotationWebTests.testAnnoDefinedManagedThreadFactoryQualifersWeb:83->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnoDefinedManagedThreadFactoryQualifersWeb
[ERROR] AnnotationWebTests.testAnnotationDefinesContextService:88->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnotationDefinesContextService
[ERROR] AnnotationWebTests.testAnnotationDefinesManagedExecutor:93->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnotationDefinesManagedExecutor
[ERROR] AnnotationWebTests.testAnnotationDefinesManagedScheduledExecutor:98->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/AnnotationServlet?testMethod=testAnnotationDefinesManagedScheduledExecutor
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinedContextServiceQualifiers:82->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedContextServiceQualifiers
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinedManagedExecutorSvcQualifiers:87->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedExecutorSvcQualifiers
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinedManagedScheduledExecutorSvcQualifers:92->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedScheduledExecutorSvcQualifers
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinedManagedThreadFactoryQualifers:97->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedThreadFactoryQualifers
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinesContextService:102->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesContextService
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinesManagedExecutor:107->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesManagedExecutor
[ERROR] DeploymentDescriptorFullTests.testDeploymentDescriptorDefinesManagedScheduledExecutor:112->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.IOException requesting URL=http://localhost:8080/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesManagedScheduledExecutor
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinedContextServiceQualifiers:68->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedContextServiceQualifiers
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinedManagedExecutorSvcQualifiers:73->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedExecutorSvcQualifiers
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinedManagedScheduledExecutorSvcQualifers:78->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedScheduledExecutorSvcQualifers
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinedManagedThreadFactoryQualifers:83->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinedManagedThreadFactoryQualifers
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinesContextService:88->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesContextService
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinesManagedExecutor:93->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.FileNotFoundException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesManagedExecutor
[ERROR] DeploymentDescriptorWebTests.testDeploymentDescriptorDefinesManagedScheduledExecutor:98->TestClient.runTest:63->TestClient.assertSuccessfulURLResponse:150 » Runtime Exception: java.io.IOException requesting URL=http://localhost:8080/DeploymentDescriptorTests_web/DeploymentDescriptorServlet?testMethod=testDeploymentDescriptorDefinesManagedScheduledExecutor
[INFO]
[ERROR] Tests run: 295, Failures: 8, Errors: 21, Skipped: 27
… if not specified
@Pandrex247 Fixed, thanks for the test! |
Pandrex247
approved these changes
Feb 21, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Add configuration of virtual threads for all types of Concurrency -- ManagedExecutorService, ManagedScheduledExecutorService, and ManagedThreadFactory
In all 3 cases, there are 3 ways, how to configure usage of virtual threads:
*Definition with
virtual = true
. E.g.@ManagedExecutorDefinition(name = "java:app/VirtMES", maxAsync = 10, virtual = true)
asadmin
command with--useVirtualThread=true
, e.g.create-managed-thread-factory --useVirtualThreads=true --target=domain concurrent/VirtFactory
Testing
I wrote a sample application: https://github.com/aubi/samples/tree/main/jakartaee/concurrency/ConcurrencyVirtual
Compile it using Java 21. Compile this branch of Payara 7, run it and execute these commands in asadmin:
Then open the link (called All VT Resources Report - simpler in the main page):
localhost:8080/ConcurrencyVirtual-1.0-SNAPSHOT/rest/test/simpler
It creates 9 threads using different configurations. Application and Server-defined use virtual threads, the default ones use platform threads. Feel free to change the settings and observe the effect -- you need to reload the app to propagate the change. Default resources require server restart (they are cached).
The expected output is
Testing Performed
Creating MES, MSES, MTF via Admin UI or asadmin commands
Changing settings in Admin UI
Verifying the behaviour in the testing app.
Testing Environment
Linux, Open JDK 21
Documentation
payara/Payara-Documentation#551